<extend name="Common@Layout:hui-admin" />
<block name="title"><title>应用私有用户-用户管理-Administator管理后台</title></block>
<block name="style">
<style>
.playlink{position:absolute;z-index:2;display:block;width:100%;height:120px;text-align:center;line-height:120px;width:214px;
filter:alpha(opacity=40); 
-moz-opacity:0.4; 
opacity:0.4;}
.playlink .icon{font-size:60px;color:#000;}
.playlink:hover{text-decoration: none;filter:alpha(opacity=100); 
-moz-opacity:1; 
opacity:1;}
.playlink:hover .icon{display:inline-block;}	
</style>
</block>

<block name="main">
	<nav class="breadcrumb">
		<i class="Hui-iconfont"></i>
		 首页 <span class="c-gray en">&gt;</span>
	             内容管理 <span class="c-gray en">&gt;</span>  
		视频管理
		<a class="btn btn-success radius r mr-20" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新"><i class="Hui-iconfont"></i></a>
	</nav>
	
	<div class="pd-20">
		<div class="text-c"> 
			<form action="{:U('Media/videos')}" method="get">
			<span class="select-box inline">
			<php>
				$searchtypes = array(
						'标题'=>'标题',
						//'id'=>'视频ID',
						'filename'=>'视频原名',
						//'type'=> '视频格式',
						//'key'=>'HashKey',
					);
			</php>
			<select name="searchtype" class="select">
				<foreach name="searchtypes" item="vo">
					<option value="{$key}" <eq name="_GET['searchtype']" value="$key">selected</eq>>{$vo}</option>
				</foreach>
			</select>
			</span> 日期范围：
			<input type="text" name="start_time" value="{$_GET['start_time']}" class="input-text mini-time" style="width:120px;">
			-
			<input type="text" name="end_time" value="{$_GET['end_time']}" class="input-text mini-time" style="width:120px;">
			<input type="text" name="keywords" value="{$_GET['keywords']}" id="" placeholder="关键词" style="width:250px" class="input-text">
			<button name="" id="" class="btn btn-success" type="submit"><i class="Hui-iconfont"></i> 搜索</button>
			</form>
		</div>
		<div class="cl pd-5 bg-1 bk-gray mt-20"> 
			
			<a href="javascript:;" class="btn btn-danger radius ajax-post confirm shuaxin" target-form="mini-form" data-msg="确定批量删除？" data-url="{:U('Media/del')}"><i class="Hui-iconfont"></i> 批量删除</a> 
			<a href="javascript:;" class="btn btn-primary" onclick="open_iframe_dialog('{:u('upload')}','上传视频',['90%','90%'],0)">上传视频</a> 
		</div>
		<php>
			if($_SESSION['loginUser']['role'] != 'ROLE_SUPER_ADMIN'){
				$map['uid'] = $_SESSION['loginUser']['uid'];
			}
			$result = _get_list_data('/material/media/videos/',$_GET,$map,D('MaterialVideos'));
		</php>
		<form class="mini-form">
		<table class="table table-border table-bordered table-hover table-bg mini-sort">
			<thead>

				<tr class="text-c">
					<th width="25"><input type="checkbox" value="" name=""></th>
					<th width="40">ID</th>
					<th>标题</th>
					<th>简介</th>
					<th>视频原名</th>
					<th>大小</th>				
					<th>类型</th>
					
					<th>封面</th>
					<th>更新时间</th>
					<th width="70">操作</th>
				</tr>
			</thead>
			<tbody>
				<foreach name="result['data']['list']" item="vo">
				<tr class="text-c">
					<td><input type="checkbox" value="{$vo.id}" name="ids[]"></td>
					<td>{:replace_query_str($_GET['keywords'],$vo['id'])}</td>
					<td>{$vo.title}</td>
					<td>{$vo.desc}</td>
					<td>{:replace_query_str($_GET['keywords'],$vo['filename'])}</td>
					<td><php>echo sprintf("%.2f", $vo['size']/1024/1024);</php>M</td>
					<td>{:replace_query_str($_GET['keywords'],$vo['type'])}</td>
					<td style="text-align:left;">
						<a href="/material/media/playfull/id/{$vo['id']}/vframe/{$vo.vframe}" target="_blank" id="showVideoLink" class="playlink">
							<i class="icon Hui-iconfont"></i>
						</a>
						<img src="{$vo.url}?vframe/jpg/offset/{$vo.vframe}" height="120px" width="214px">
					</td>
					<td>{$vo.update_time}</td>
					<td class="f-14">
						<a href="javascript:;" onclick="open_iframe_dialog('{:u('upload','id='.$vo['id'])}','修改视频',['90%','90%'],0)"><i class="Hui-iconfont"></i></a> 
            			<a style="text-decoration:none" class="ml-5 mini_del" data-url="{:U('media/del','ids='.$vo['id'])}" href="javascript:;" title="删除"><i class="Hui-iconfont"></i></a>
					</td>
				</tr>
				</foreach>
			</tbody>
		</table>
		</form>
		{$result['pagetpl']}
	</div>
</block>

<block name="script">
<script>
$('#changeG').change(function(){
	window.location.href="/admin/Users/app/appid/"+$('#changeG').val();
});
$(function(){
	$('.mini-time').datepicker();
});

function mini_callback(data){
	history.go(0);
}
</script>
</block>